package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ActivityTagMapper;
import com.ruoyi.system.domain.ActivityTag;
import com.ruoyi.system.service.IActivityTagService;
import com.ruoyi.common.core.text.Convert;

/**
 * 活动标签Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-12
 */
@Service
public class ActivityTagServiceImpl implements IActivityTagService 
{
    @Autowired
    private ActivityTagMapper activityTagMapper;

    /**
     * 查询活动标签
     * 
     * @param id 活动标签主键
     * @return 活动标签
     */
    @Override
    public ActivityTag selectActivityTagById(String id)
    {
        return activityTagMapper.selectActivityTagById(id);
    }

    /**
     * 查询活动标签列表
     * 
     * @param activityTag 活动标签
     * @return 活动标签
     */
    @Override
    public List<ActivityTag> selectActivityTagList(ActivityTag activityTag)
    {
        return activityTagMapper.selectActivityTagList(activityTag);
    }

    /**
     * 新增活动标签
     * 
     * @param activityTag 活动标签
     * @return 结果
     */
    @Override
    public int insertActivityTag(ActivityTag activityTag)
    {
        activityTag.setCreateTime(DateUtils.getNowDate());
        return activityTagMapper.insertActivityTag(activityTag);
    }

    /**
     * 修改活动标签
     * 
     * @param activityTag 活动标签
     * @return 结果
     */
    @Override
    public int updateActivityTag(ActivityTag activityTag)
    {
        activityTag.setUpdateTime(DateUtils.getNowDate());
        return activityTagMapper.updateActivityTag(activityTag);
    }

    /**
     * 批量删除活动标签
     * 
     * @param ids 需要删除的活动标签主键
     * @return 结果
     */
    @Override
    public int deleteActivityTagByIds(String ids)
    {
        return activityTagMapper.deleteActivityTagByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除活动标签信息
     * 
     * @param id 活动标签主键
     * @return 结果
     */
    @Override
    public int deleteActivityTagById(String id)
    {
        return activityTagMapper.deleteActivityTagById(id);
    }
}
